<%@page import="controller.Utils"%>
<%@page import="java.text.NumberFormat"%>
<%@page import="models.Domain"%>
<%@page import="com.googlecode.objectify.Query"%>
<%
	Domain list = (Domain) request.getAttribute("list");
	String domain = (String) request.getAttribute("domain");
	int pages = Integer.parseInt((String) request.getAttribute("page"));
	NumberFormat nf = NumberFormat.getInstance();
	String url = "out-link/" + domain;

	String title = "Page - " + pages + " | Out link " + domain;
	String description = "Out link " + domain + " Page - " + pages
			+ ".The domain has the in link " + domain
			+ " on showsiteinfo";
	String keyword = domain + "," + "link,out-link,check link";
%>

<jsp:include page="layout/header.jsp">
	<jsp:param name="title" value="<%=title%>" />
	<jsp:param name="description" value="<%=description%>" />
	<jsp:param name="keywords" value="<%=keyword%>" />
</jsp:include>

<div class="bd">
	<div class="l">
		<div class="rib">
			<h1>
				<a href="/sites/<%=domain%>" class="white"><%=domain%></a>
			</h1>
		</div>
		<div class="cont">
			<%
				int count = 0;
				if (list != null && list.getOutLink() != null
						&& !list.getOutLink().getValue().equals("")) {
					String[] arrs = list.getOutLink().getValue().split(",");
					count = arrs.length;
				}
			%>
			<p>
				Out-link is a link that points from your website to another website.
				These are out-links list of <i><%=domain%></i> ( <strong><%=count%></strong>
				)
			</p>

			<div id="featuredservice">
				<table class="exp">
					<%
						int start = (pages - 1) * 30;
						int end = (pages - 1) * 30 + 30;
						int k = 0;
						if (list != null && list.getOutLink() != null
								&& !list.getOutLink().getValue().equals("")) {
					%>
					<tr>
						<th>Domain</th>
						<th></th>
					</tr>
					<%
						String[] arr = list.getOutLink().getValue().split(",");
							if (end > arr.length) {
								end = arr.length;
							}
							for (int i = start; i < end; i++) {
								k++;
					%>
					<tr>
						<td>
							<%
								if (!Utils.fomatDomain(arr[i]).trim().equals("")) {
							%><a
							href="/sites/<%=Utils.fomatDomain(arr[i])%>"><%=Utils.fomatDomain(arr[i])%></a>
							<%
								}
							%>
						</td>
						<td class="right">
							<%
								if (!Utils.fomatDomain(arr[i]).trim().equals("")) {
							%><a
							href="/check-link/<%=Utils.fomatDomain(arr[i])%>" rel="nofollow">Check
								link</a>
							<%
								}
							%>
						</td>
					</tr>
					<%
						}
						} else {
					%>
					<tr>
						<td>Currently, we don't find out-links from your site. You
							can use tools is listed below to find more and more information
							about your site. <br />
						<br /> <a href="/network-tool">Network tool</a> | <a
							href="/pagerank">Check pagerank</a> | <a href="/lookup-ip">Lookup
								ip</a>
						</td>
					</tr>
					<%
						}
					%>
				</table>
			</div>
			<div class="cl"></div>
			<ul>
				<li class="paginate"><jsp:include page="paginate.jsp">
						<jsp:param name="cur_page" value="<%=pages%>" />
						<jsp:param name="url" value="<%=url%>" />
						<jsp:param name="number_game" value="<%=k%>" />
					</jsp:include></li>
			</ul>
			<div class="cl"></div>
		</div>
	</div>
	<div class="r">
		<%@ include file='/element/search.jsp'%>

		<div class="bol">
				<jsp:include page="adv/adv2.jsp"></jsp:include> 
			</div>
			<div class="bol">
				<jsp:include page="adv/adv2.jsp"></jsp:include> 
			</div>
	</div>
</div>

<jsp:include page="layout/footer.jsp"></jsp:include>
